package org.liuchang.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.liuchang.model.Pay;
import org.liuchang.model.Type;
import org.liuchang.service.PayService;
import org.liuchang.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(value = "消息", description = "消息操作 API", position = 100, protocols = "http")
@RestController
@RequestMapping("/")
public class TypeController {

    @Autowired
    private TypeService typeService;


    @ApiOperation(
            value = "查询",
            notes = "根据type查询消费类型",
            produces="application/json",
            consumes="application/json",
            response = List.class)
    @GetMapping(value = "/type/{type}")
    public List<Type> findByType(@PathVariable int type) {
        return typeService.findByType(type);
    }
}
